home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 029a / sprbrow.zip / BROWZE.DOC < prev    next >
Text File  |  1991-06-13  |  3KB  |  57 lines

  1.                    Fancy Browsing
  2.       Once upon a time, creating pop-up pick lists was a tedious
  3. task. You had to select the file, define the fields that would be
  4. shown, control what each keypress would do. It took even more pains
  5. to define the labels that would appear over the fields and format
  6. calculated fields if you used them. Unless you took the time to do
  7. it properly, you had to create a new routine for each pick list.
  8. With Foxpro's BROWSE command, these routines can now be created in
  9. a matter of minutes. However, even this command did not do
  10. everything. It let users select a record by using the positioning
  11. keys (arrows, PgUp, PgDn), but it did not allow them to enter a
  12. value. If the data file contained thousands of records and the one
  13. desired was somewhere in the middle, the user would still have to
  14. press the PgDn key many times. Y. Alan Griver showed us how to use
  15. the On Key Label function to enter values during a browse. I have
  16. used his concept here and included additional features such as: 
  17.  1) making it a generic routine, callable with a few lines of code
  18. from any program
  19.  2) allowing the use of files which are non-indexed, indexed or
  20. indexed on multiple fields
  21.  3) having it work identically on character, numeric or date
  22. fields. It will search from the leftmost characters entered. A 7
  23. will find the first search field beginning with 7. (7, 70-79,
  24. 700-799). Naturally, this search will be slower than an indexed
  25. seek.
  26.  4) allowing the user to add a record to the file, if the
  27. programmer permits it.
  28.  5) display of the search key being built and the field being
  29. located for that value
  30.  6) selecting multiple records with one call to Browze
  31.  7) allowing the search to work on any field in the browse that
  32. belongs to the active database. If the user moves the cursor over
  33. to the next field, (and that field exists in the active database)
  34. any previously entered search value is cleared and the locate for
  35. the new search value entered will take place against that field.
  36. However, only the first field in the browse list can be SEEKed.
  37. This feature must be disabled if the browse uses the key clause,
  38. where only records for which the index key matches a specific value
  39. are shown. The reason for this is that the locate might match a
  40. record with a different index value. Since the located record would
  41. not appear in the browse, it would confuse the user. 
  42.       I use this routine in all my programs to allow the user to
  43. select records from a pick list. The program TEST demonstrates 
  44. various uses of BROWZE including using it to select multiple records. 
  45. By passing an third parameter of .t., the return key no longer selects 
  46. the record and exits, it selects the record, moves down to the next 
  47. record and waits for another record to be selected, the ESC key to be
  48. pressed to cancel or F2, signalling the end of the selection process. 
  49. Pressing return also resets the search key to blank, so that it is ready 
  50. for the next search value.
  51.       I am sure that once some of you power users start playing
  52. with this, you will find ways to make it faster, easier and more
  53. powerful. I would appreciate hearing from you. 
  54.       (Yisroel Goodman is Complete Computer Services, Inc. He lives
  55. and works in Far Rockaway, NY. When not designing and coding, he is
  56. working on other projects, such as Shayna and Dani. He can be
  57. reached at (718) 868-3000 or on Compuserve 70243,443)